package com.mrd.framework.security.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * 字段义权限配置 Created by winaya on 2016/8/23.
 */
@Configuration
@Component
public class MrdSecurityProperties {

    /**
     * 登录页面 mrd.security.login.page=/login
     */
    @Value("${mrd.security.login.page}")
    private String loginPage;
    /**
     * 提交路径 mrd.security.login.post=/login
     */
    @Value("${mrd.security.login.post}")
    private String loginPost;
    /**
     * 登录成功后的地址 mrd.security.success.page=/index
     */
    @Value("${mrd.security.success.page}")
    private String successPage;
    /**
     * 注销路径 mrd.security.loginOut.page=/logout
     */
    @Value("${mrd.security.logout.page}")
    private String loginOutPage;
    /**
     * 注销路径 mrd.security.loginOut.post=/login
     */
    @Value("${mrd.security.logout.post}")
    private String loginOutPost;
    /**
     * 权限验证失败的页面（ajax访问通过ajax形式返回“权限验证失败”文字） mrd.security.error.page=/403
     */
    @Value("${mrd.security.error.page}")
    private String errorPage;
    /**
     * 登录表单，用户名名称 mrd.security.name.user.name=userName
     */
    @Value("${mrd.security.name.user.name}")
    private String nameUserName;
    /**
     * 登录表单，用户密码 mrd.security.name.password.name=pwd
     */
    @Value("${mrd.security.name.password.name}")
    private String namePasswordName;
    /**
     * session超时 mrd.security.sessionFail.page=/login
     */
    @Value("${mrd.security.sessionFail.page}")
    private String sessionFailPage;

    public String getLoginPage() {
        return loginPage;
    }

    public void setLoginPage(String loginPage) {
        this.loginPage = loginPage;
    }

    public String getLoginPost() {
        return loginPost;
    }

    public void setLoginPost(String loginPost) {
        this.loginPost = loginPost;
    }

    public String getSuccessPage() {
        return successPage;
    }

    public void setSuccessPage(String successPage) {
        this.successPage = successPage;
    }

    public String getLoginOutPage() {
        return loginOutPage;
    }

    public void setLoginOutPage(String loginOutPage) {
        this.loginOutPage = loginOutPage;
    }

    public String getLoginOutPost() {
        return loginOutPost;
    }

    public void setLoginOutPost(String loginOutPost) {
        this.loginOutPost = loginOutPost;
    }

    public String getErrorPage() {
        return errorPage;
    }

    public void setErrorPage(String errorPage) {
        this.errorPage = errorPage;
    }

    public String getNameUserName() {
        return nameUserName;
    }

    public void setNameUserName(String nameUserName) {
        this.nameUserName = nameUserName;
    }

    public String getNamePasswordName() {
        return namePasswordName;
    }

    public void setNamePasswordName(String namePasswordName) {
        this.namePasswordName = namePasswordName;
    }

    public String getSessionFailPage() {
        return sessionFailPage;
    }

    public void setSessionFailPage(String sessionFailPage) {
        this.sessionFailPage = sessionFailPage;
    }
}
